package net.godcode.olivenotes.pages.blog;

import java.util.List;

import net.godcode.olivenotes.entities.Post;
import net.godcode.olivenotes.entities.PostDAO;

import org.apache.tapestry.ioc.annotations.Inject;
import org.slf4j.Logger;

/**
 * Tags
 * 
 * @author Chris Lewis Jan 10, 2008 <chris@thegodcode.net>
 * @version $Id: Tags.java 20 2008-01-15 07:22:45Z burningodzilla $
 */
public class Tags {
	
	@Inject
	private PostDAO postDao;
	
	@Inject
	private Logger log;
	
	private Post post;
	
	private List<Post> posts;
	
	void onActivate(String tag) {
		if(tag == null) {
			//TODO implement tag cloud
		}
		posts = postDao.findByTag(tag, true);
	}

	/**
	 * @return the post
	 */
	public Post getPost() {
		return post;
	}

	/**
	 * @param post the post to set
	 */
	public void setPost(Post post) {
		this.post = post;
	}

	/**
	 * @return the posts
	 */
	public List<Post> getPosts() {
		return posts;
	}
	
}